<template>
	<el-container  class="home-container">
	  <el-header>
	  	<el-row>
			  <el-col :span="8" class="logo">
			  	<img src="@/assets/logo.png"/>
			  </el-col>
			  <el-col :span="8">
			  	<h1 class="title">我是一个后台</h1>
			  </el-col>
			  <el-col :span="8">
			  	<div class="welcome">
			  		<span>欢迎来到页面</span>
			  		<a href="#" @click.prevent="logout">退出</a>
			  	</div>
			  </el-col>
			</el-row>
	  </el-header>
	  <el-container>
	    <el-aside width="200px">
	    	<el-menu :router="true"
      default-active="1-1"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      
	      <el-submenu index="1">
	        <template slot="title">
	          <i class="el-icon-location"></i>
	          <span>用户管理</span>
	        </template>
	        <el-menu-item-group>
	          <el-menu-item index="/home/users">用户列表</el-menu-item>
	        </el-menu-item-group>
	      </el-submenu>
	      
	      <el-submenu index="2">
	        <template slot="title">
	          <i class="el-icon-location"></i>
	          <span>用户管理</span>
	        </template>
	        <el-menu-item-group>
	          <el-menu-item index="2-1">
	          	<template slot="title">
			          <i class="el-icon-star-on"></i>
			          <span>用户管1理</span>
			        </template>
	          </el-menu-item>
	        </el-menu-item-group>
	      </el-submenu>
	      
	   	 </el-menu>
	    </el-aside>
	    
	    <el-main>
	    	<router-view/>
	    </el-main>
	    
	  </el-container>
	</el-container>
</template>

<script>
	export default {
		methods:{
			logout(){
        this.$confirm('您是否确定退出?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          localStorage.removeItem('token')
          this.$router.push("/login")
        })
//      .catch(() => {
//        this.$message({
//          type: 'info',
//          message: '已取消删除'
//        });          
//      });
     },
     handleOpen(key, keyPath) {
//      console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
//      console.log(key, keyPath);
      }
			
		}
		
	}
</script>

<style scoped lang="less">
	.home-container {
  	height: 100%;
		.el-header{
	    background-color: #b3c1cd;
	    color: #333;
	    text-align: center;
	    padding: 0;
	    .logo{
	    	text-align: left;
	    }
	    .title{
	    	margin: 0;
	    	line-height: 60px;
	    	font-size: 36px;
	    	color: #fff;
	    }
	    .welcome{
	    	line-height: 60px;
	    	text-align: right;
	    	padding-right: 50px;
	    	span{
	    		font-weight: bold;
	    		
	    	}
	    	a{
	    		color: #fff;
	    		text-decoration: none;
	    	}
	    }
	  }
	  
	  .el-aside {
	    background-color: #545c64;
	    color: #333;
	    line-height: 200px;
	    .el-submenu{
	    	width: 200px;
	    }
	  }
	  
	  .el-main {
	    background-color: #E9EEF3;
	    color: #333;
	  }
	  
	
	
	  
	  .el-container:nth-child(5) .el-aside,
	  .el-container:nth-child(6) .el-aside {
	    line-height: 260px;
	  }
	  
	  .el-container:nth-child(7) .el-aside {
	    line-height: 320px;
	  }
  }
  
</style>